<?php
if(!isset($_REQUEST["application"])){
    include_once "../../core/_includes/configuration.php";
}else{
    switch($_REQUEST["application"]){
        case "WebMotor":
        default:
            include_once "core/_includes/configuration.php";
            include_once "core/_cpu/Core.php";
            include_once "core/WebMotor.php";
            include_once "core/_classes/Configuration.php";
            break;
    }
}

function __autoload($className) {
	$possibilities = array( 
        '_plugins'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_classes'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_processes'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_applications'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_memory'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_ram'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'_cpu'.DIRECTORY_SEPARATOR.$className.'.php', 
        '..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.$className.'.php' 
    ); 
    foreach ($possibilities as $file) { 
        if (file_exists($file)) { 
            require_once($file); 
            return true; 
        } 
    } 
    echo "<p>ERROR DEL AUTOLOAD!, clase no encontrada: ".$className."</p>";
    return false; 
}